package com.rogue.system.controller;

import com.github.pagehelper.PageInfo;
import com.rogue.common.core.utils.ResultDTO;
import com.rogue.system.domain.dto.VerifyDTO;
import com.rogue.system.domain.vo.VerifyPageVo;
import com.rogue.system.service.HsVerifyInfoService;
import javax.annotation.Resource;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YeahLiang
 * @date: 2022/04/13 15:18
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/verify")
public class VerifyController {

    @Resource
    private final HsVerifyInfoService hsVerifyInfoService;

    @RequestMapping("/listWithUserType")
    public ResultDTO<PageInfo<VerifyPageVo>> listWithUserType(@RequestBody VerifyDTO verifyDTO){
        return ResultDTO.success(hsVerifyInfoService.listWithUserType(verifyDTO));
    }

    @RequestMapping("/accept")
    public ResultDTO<Boolean> accept(@RequestBody VerifyDTO verifyDTO) {
        return ResultDTO.success(hsVerifyInfoService.accept(verifyDTO));
    }

    @RequestMapping("/reject")
    public ResultDTO<Boolean> reject(@RequestBody VerifyDTO verifyDTO) {
        return ResultDTO.success(hsVerifyInfoService.reject(verifyDTO));
    }
}
